num = int(input('请输入一个数'))
while True:
    if num == 1000:
        break
    num+=1
    if num % 7 == 0 or '7' in str(num):
        continue
    print(num)
print('game over')  